<?php
session_start();

$debut = $_SESSION['debut'];
$fin = $_SESSION['fin'];
$timeout = $_SESSION['timeout'];
$scan = $_SESSION['scan'];
session_destroy();
?>
<h3>R&eacute;sultats du scan de la plage de ports</h3>
<p>
<?php
error_reporting(0);
$ip = $_SERVER['REMOTE_ADDR'];
function ping($ip, $port, $type, $timeout){
if(fsockopen($ip, $port, $errno, $errstr, $timeout)) {
echo("<br>$type : OK</br>");
}
else {
echo("<br>$type : Erreur</br>");
}
}
?>
<?php
$port = $debut;
if($scan = 0) {
while($port < $fin) {
ping($ip, $port, $port, $timeout);
$port + 1;
}
}
?>
</p>

